<?php

use app\common\service\order\coupon_order\jutuike_channel\Cron;
use app\model\CouponBrand;
use think\migration\Migrator;

class AlterCouponBrandChangeServType extends Migrator
{
    public function up()
    {
        //先拉取一次聚推客活动，再去修改所属服务
        $cron = new Cron();
        $cron->cron();
        $pullOrders = [
            47 => PRODUCT_TRAVEL_OIL_SERV,//高德
            42 => PRODUCT_TRAVEL_OIL_SERV,//出行，加油
            87 => PRODUCT_TRAVEL_OIL_SERV,//同程打车
            49 => PRODUCT_TRAVEL_OIL_SERV,//花小猪
            63 => PRODUCT_TRAVEL_OIL_SERV,//花小猪司机
            43 => PRODUCT_TRAVEL_OIL_SERV,//滴滴加油nani
            44 => PRODUCT_TRAVEL_OIL_SERV,//货运
            58 => PRODUCT_TRAVEL_OIL_SERV,//小桔加油
            67 => PRODUCT_TRAVEL_OIL_SERV,//滴滴有车
            //周边游
            54 => PRODUCT_AROUND_SHOP_SERV, //联联周边游
            62 => PRODUCT_AROUND_SHOP_SERV, //旅划算周边游
            //餐饮
            57 => PRODUCT_FOOD_SHOP_SERV, //聚合点餐
            46 => PRODUCT_FOOD_SHOP_SERV,//汉堡王
            34 => PRODUCT_FOOD_SHOP_SERV, //星巴克
            26 => PRODUCT_FOOD_SHOP_SERV, //麦当劳
            16 => PRODUCT_FOOD_SHOP_SERV, //肯德基
            31 => PRODUCT_FOOD_SHOP_SERV, //百果园
            32 => PRODUCT_FOOD_SHOP_SERV, //奈雪的茶
            33 => PRODUCT_FOOD_SHOP_SERV, //瑞幸咖啡
            37 => PRODUCT_FOOD_SHOP_SERV, //喜茶
            38 => PRODUCT_FOOD_SHOP_SERV, //肯德基活动2
            45 => PRODUCT_FOOD_SHOP_SERV, //美团外卖优质商家
            64 => PRODUCT_FOOD_SHOP_SERV, //必胜客
            4 => PRODUCT_ELE_SERV, //饿了么餐饮红包CPS
            5 => PRODUCT_ELE_SERV, //饿了么生鲜CPS推广活动
            3 => PRODUCT_ELE_SERV, //美团闪购CPS+CPA推广活动
            1 => PRODUCT_FOOD_SHOP_SERV, //美团外卖CPS推广活动 ①
            2 => PRODUCT_FOOD_SHOP_SERV, //美团闪购CPS+CPA推广活动
            28 => PRODUCT_FOOD_SHOP_SERV, //美团酒店CPS推广活动
            9 => PRODUCT_FOOD_SHOP_SERV, //美团到店优惠活动
            27 => PRODUCT_FOOD_SHOP_SERV, //美团周末特价活动
            7 => PRODUCT_FOOD_SHOP_SERV, //美团外卖CPS推广活动
            8 => PRODUCT_FOOD_SHOP_SERV, //美团闪购CPS推广活动
        ];
        foreach ($pullOrders as $act_id => $servType) {
            CouponBrand::findOrCreate(
                [
                    'act_id' => $act_id,
                ],
                [
                    'serv_type' => $servType,
                ]
            );
        }
    }
}
